import java.sql.ResultSet;

import java.sql.DriverManager;

import java.sql.*;

public class homeworkTest {
    Connection conn = DriverManager.getConnection("url", "use", "pwd");
    //实现数据库的连接
    Statement st=conn.createStatement();
    //实现数据库的持久化
    String sql = "select * from courseInfo";
    ResultSet rs = st.executeQuery(sql);
    while (rs.next()){
        System.out.print("courseName:"+rs.getString("courseName"));
        System.out.print(";");
        System.out.print("address:"+rs.getString("address"));
        System.out.print(";");
        System.out.print("courseTeacher:"+rs.getString("courseTeacher"));
        System.out.print(";");

    }
            rs.close();//进行关闭
}
